#pragma once

#include <glm/glm.hpp>
#include "material.hpp"

struct Ray {
    glm::vec3 origin;
    glm::vec3 direction;

    glm::vec3 hit (float t) const { return origin + direction * t;}

    Ray objectRromWorld(const glm::mat4 &object_from_world )const;
};  

struct HitInfo {
    //交点距离
    float t;
    //交点位置
    glm::vec3 hit_point;
    //交点法线
    glm::vec3 normal;

    const Material *material = nullptr;
};